$(function () {
    window.xxx = "****";
    // 判断token是否存在

    let res = localStorage.getItem("mytoken");
    if (res == null) {
        location.href = "/login.html";
    }

    // 退出按钮的点击事件
    let layer;
    layui.use(['layer'], function () {
        layer = layui.layer;

        // 退出模块
        $("#logout-btn").on("click", function () {
            layer.confirm('确定要退出?', function (index) {

                // 关闭弹窗
                layer.close(index);
                // *******************************************token的补丁3
                // 跳页面
                location.href = "/login.html";
                localStorage.removeItem("mytoken");
            });
        });
    });

})